package com.example.demo.com.example.demo.controller;

import org.apache.poi.hssf.extractor.ExcelExtractor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;


import java.io.FileInputStream;
import java.io.InputStream;

//数据抽取
public class demo4 {
    public static void main(String[] args) throws  Exception {
        InputStream fileOutputStream = new FileInputStream("d:\\我的第一个workboot1.xls");
        POIFSFileSystem poifsFileSystem = new POIFSFileSystem(fileOutputStream);
        HSSFWorkbook sheets = new HSSFWorkbook(poifsFileSystem);
        ExcelExtractor excelExtractor = new ExcelExtractor(sheets);
        excelExtractor.setIncludeSheetNames(false);//不需要sheet页的名字


        System.out.println(excelExtractor.getText());

    }
}
